package weaver.splittable.biz.workflow;

import java.util.LinkedHashMap;
import java.util.Map;

public class STWorkflowConstants {

    public static final Map<String, String> SPLIT_TABLES = new LinkedHashMap<>();

    // 需要进行分表操作的业务表
    public static final String SPLIT_TABLE_WORKFLOW_REQUESTBASE = "workflow_requestbase";
    public static final String SPLIT_TABLE_WORKFLOW_CURRENTOPERATOR = "workflow_currentoperator";
    public static final String SPLIT_TABLE_WORKFLOW_REQUESTLOG = "workflow_requestLog";

    // 业务表对应的唯一主键
    public static final String WORKFLOW_REQUESTBASE_DATAID = "requestid";
    public static final String WORKFLOW_CURRENTOPERATOR = "ID";
    public static final String WORKFLOW_REQUESTLOG = "LOGID";

    static {
        SPLIT_TABLES.put(SPLIT_TABLE_WORKFLOW_REQUESTBASE, WORKFLOW_REQUESTBASE_DATAID); // 按流程的清理逻辑，这张表必须第一个放入，清理数据需要先清理这张表的数据
        SPLIT_TABLES.put(SPLIT_TABLE_WORKFLOW_CURRENTOPERATOR, WORKFLOW_CURRENTOPERATOR);
        SPLIT_TABLES.put(SPLIT_TABLE_WORKFLOW_REQUESTLOG, WORKFLOW_REQUESTLOG);
    }

}
